#ifndef INCIDENTLOGDATABASE_H
#define INCIDENTLOGDATABASE_H


#ifdef _WIN32
    #ifdef DATABASE_EXPORTS
        #define DATABASE_API __declspec(dllexport)
    #else
        #define DATABASE_API __declspec(dllimport)
        #pragma comment (lib, "Database.lib")
    #endif // End of DATABASE_EXPORTS
#else  // End of _WIN32
    #ifdef __GNUC__
        #if (__GNUC__ >= 4)
            #define DATABASE_API __attribute__((visibility("default")))
        #else
            #define DATABASE_API
        #endif
    #else
        #define DATABASE_API
    #endif
#endif


#include <string>

class SQLiteWrapper;

class IncidentLogDatabase
{
public:
    IncidentLogDatabase();

    virtual ~IncidentLogDatabase();
    
    static IncidentLogDatabase* GetInstance();

    bool Initialize(const std::string& strDbPath);

    bool AddIncidentLog(const std::string &strUrl, const std::string& strLog);

    bool GetData(const std::string& strUrl);

    bool GetTopData(const std::string& strUrl, const int nTopNum);

    bool UpdateTopData(const std::string& strUrl, const int nTopNum);

    int CountByUrl(const std::string& strUrl);

    bool DeleteData(const std::string& strUrl);

    bool DeleteData(const int flag);

    bool ClearDataBase();

    void Close();

    std::string GetGuid();

private:
    SQLiteWrapper* m_pSqliteWrapper;
};

#endif /*!INCIDENTLOGDATABASE_H*/ 